home *** CD-ROM | disk | FTP | other *** search
/ Network Support Library / RoseWare - Network Support Library.iso / apidev / tpapi.exe / NWSYNCH.PA1 < prev    next >
Text File  |  1994-01-14  |  8KB  |  186 lines

  1. {#Z+}
  2. (*(10U&l12D(s4099T&k2S*)
  3. {***************************************************************************}
  4. {** Program : NWSYNCH                                                     **}
  5. {***************************************************************************}
  6. {** Version : 1.53             ** Started : 11/11/91  ** Ended :   /  /   **}
  7. {***************************************************************************}
  8. {******************************** Description ******************************}
  9. {***************************************************************************}
  10. {** OOP library for Netware API                                           **}
  11. {**                                                                       **}
  12. {** This unit forms the second level object : SYNCHRONISATION             **}
  13. {** This object is a descandent of          : NETWARE                     **}
  14. {**                                                                       **}
  15. {**                                                                       **}
  16. {**                                                                       **}
  17. {**                                                                       **}
  18. {***************************************************************************}
  19. {******************************** Information ******************************}
  20. {***************************************************************************}
  21. {** Provides Netware Synchronisation Services                             **}
  22. {**                                                                       **}
  23. {**                                                                       **}
  24. {**                                                                       **}
  25. {** This code is (c) 1991 - 1994 Antonio Covelli. ALL RIGHTS RESERVED.    **}
  26. {** Portions (c) Novell Inc,                                              **}
  27. {**                                                                       **}
  28. {**                                                                       **}
  29. {***************************************************************************}
  30.  
  31. {$I NETWARE.INC}
  32. {#Z-}
  33.  
  34. UNIT NWSYNCH;
  35.  
  36. INTERFACE
  37.  
  38. USES
  39.  
  40.   nwvar,
  41.   netware;
  42.  
  43. TYPE
  44.  
  45.   PSynchronisationOBJ = ^SynchronisationOBJ;
  46.   SynchronisationOBJ  = OBJECT (NetwareOBJ)
  47.  
  48.     { This object provides Netware Synchronisation Services API's. }
  49.  
  50.     FUNCTION ClearFile (DirectoryHandle : byte; FileName : TPathName) : WORD;
  51.     { Clear a file from the client's logged files table. If the file is open it
  52.       is closed. }
  53.     {#F}
  54.     {}
  55.     { DirectoryHandle: Directory handle pointing to a directory/volume. If
  56.                   specifying a full path then should be 0. }
  57.     { FileName       : Path where the file resides. Must include the
  58.                   filename. If DirectoryHandle is 0 then FileName must include
  59.                   the volume name. eg. SYS1:\USERS\TONY\TEST.PRT. }
  60.     {#F}
  61.  
  62.     function ClearFileSet (LockFlag : byte) : word;
  63.     { Clears all files from the client's logged files table. All open files are
  64.       closed. }
  65.     {#F}
  66.     { LockFlag: }
  67.     {#F}
  68.  
  69.     FUNCTION ClearLogicalRecord (LogicalRecordName : TLogicalRecordName) : WORD;
  70.     { Clears the specified name from the client's table. The name cannot be
  71.       reused until it is relogged. Any locks associated with the name are
  72.       cleared. }
  73.     {#F}
  74.     {}
  75.     { LogicalRecordName: contains the name to clear from the client's table. }
  76.     {#F}
  77.  
  78.     function ClearLogicalRecordSet (LockFlag : byte) : word;
  79.     { Clears all names from the client's table.
  80.     {#F}
  81.     {}
  82.     { LockFlag: }
  83.     {#F}
  84.     {#X ClearLogicalRecord#}
  85.  
  86.     FUNCTION ClearPhysicalRecord (FileHandle : WORD; RecordOffset,
  87.                                   RecordLength : LONGINT) : WORD;
  88.     { Removes the specified byte range from the client's lock table. A portion
  89.       of an existing lock cannot be cleared. }
  90.     {#F}
  91.     {}
  92.     { FileHandle  : handle of the file that has a physical record lock. }
  93.     { RecordOffset: starting position within the file where the lock starts. }
  94.     { RecordLength: length of the byte range locked. }
  95.     {#F}
  96.  
  97.     function ClearPhysicalRecordSet (LockFlag : byte) : word;
  98.     { Removes all physical records in a log table and removes them from the log
  99.       table. }
  100.     {#F}
  101.     {}
  102.     { LockFlag: }
  103.     {#F}
  104.  
  105.     FUNCTION  CloseSemaphore (SemaphoreHandle : LONGINT) : WORD;
  106.     { Closes the specified Semaphore and decreases the OpenCount value by 1. }
  107.     {#F}
  108.     {}
  109.     { SemaphoreHandle: handle of the semaphore to be closed. Obtained when
  110.                   calling #OpenSemaphore#. }
  111.     {#F}
  112.  
  113.     FUNCTION ExamineSemaphore (SemaphoreHandle : LONGINT;
  114.                                VAR SemaphoreValue : integer;
  115.                                var OpenCount : BYTE) : WORD;
  116.     { Allows a client to determine the value of a semaphore. }
  117.     {#F}
  118.     {}
  119.     { SemaphoreValue: contains the current value of the semaphore. }
  120.     { OpenCount     : contains the number of clients that have the semaphore
  121.                  open. }
  122.     {#F}
  123.     {#X WaitOnSemaphore SignalSemaphore }
  124.  
  125.     FUNCTION GetLockMode : WORD;
  126.     { Returns the current locking mode. An application should set the lock mode
  127.       to $01 for all Netware v4.61 and later. Lock mode should be set to $00 for
  128.       versions prior to v4.61. The default lock mode is $00. }
  129.  
  130.     FUNCTION LockFileSet (TimeOut : WORD) : WORD;
  131.     { Attempts to lock all files logged in a log table. }
  132.     {#F}
  133.     {}
  134.     { TimeOut: Determines how long the function will attempt to lock the files.
  135.           Values are measured in ticks (1/18). A value of 0 means NO WAIT. }
  136.     {#F}
  137.  
  138.     FUNCTION LockLogicalRecordSet (LockDirective : BYTE; Timeout : WORD) : WORD;
  139.     { Attempts to lock all logical records logged in a log table. }
  140.     {#F}
  141.     {}
  142.     { LockDirective: if $00 lock with exclusive lock. }
  143.     {                if $01 lock with  shareable lock. }
  144.     {#F}
  145.     { TimeOut      : Determines how long the function will attempt to lock the
  146.                 files. Values are measured in ticks (1/18). A value of 0 means
  147.                 NO WAIT. }
  148.  
  149.     FUNCTION    LockPhysicalRecordSet    (LockDirective : BYTE; TimeOut : WORD) : WORD;
  150.  
  151.     FUNCTION    LogFile                  (FileName : TPathName; LockDirective : BYTE; TimeOut : WORD) : WORD;
  152.  
  153.     FUNCTION    LogLogicalRecord         (LogicalRecordName : TLogicalRecordName;
  154.                                           LockDirective : BYTE; TimeOut : WORD) : WORD;
  155.  
  156.     FUNCTION    LogPhysicalRecord        (FileHandle : WORD; RecordOffSet, RecordLength : LONGINT;
  157.                                           LockDirective : BYTE; TimeOut : WORD) : WORD;
  158.  
  159.     FUNCTION    OpenSemaphore            (SemaphoreName : TSemaphoreName; InitialValue : integer;
  160.                                           VAR SemaphoreHandle : LONGINT; VAR OpenCount : BYTE) : WORD;
  161.  
  162.     FUNCTION    ReleaseFile              (DirectoryHandle : byte; FileName : TPathName) : WORD;
  163.  
  164.     function    ReleaseFileSet           (LockFlag : byte) : word;
  165.  
  166.     FUNCTION    ReleaseLogicalRecord     (LogicalRecordName : TLogicalRecordName) : WORD;
  167.  
  168.     function    ReleaseLogicalRecordSet  (LockFlag : byte) : word;
  169.  
  170.     FUNCTION    ReleasePhysicalRecord    (FileHandle : WORD; RecordOffset, RecordLength : LONGINT) : WORD;
  171.  
  172.     function    ReleasePhysicalRecordSet (LockFlag : byte) : word;
  173.  
  174.     FUNCTION    SetLockMode              (LockMode : BYTE) : WORD;
  175.  
  176.     FUNCTION    SignalSemaphore          (SemaphoreHandle : LONGINT) : WORD;
  177.  
  178.     FUNCTION    WaitOnSemaphore          (SemaphoreHandle : LONGINT; TimeOut : WORD) : WORD;
  179.  
  180.     DESTRUCTOR  Done; VIRTUAL;
  181.  
  182.   END;
  183.  
  184. {#Z+}
  185.  
  186.